﻿using System;

using imaginecup.objectManager;
using imaginecup.information;
using Imaginecup.util.input;
using Microsoft.Xna.Framework.Input.Touch;
using Imaginecup.util.compute;
using Microsoft.Xna.Framework;
using Imaginecup.util.collision;
using imaginecup.util;
using Imaginecup.gameState.malaria.componentInit;
using Imaginecup.gameState.malaria.component.children;
using Imaginecup.util;
using Microsoft.Xna.Framework.Input;
using Imaginecup.sprite;
using Imaginecup.gameState.malaria.manager;
using Imaginecup.gameState.malaria.component.entity;
using System.Collections.Generic;
using Imaginecup.gameState.malaria.component.util;
using Imaginecup.util.script.malaria;
using Imaginecup.sprite.animation;
using Imaginecup.sprite.factory;

namespace Imaginecup.gameState.malaria.component.malaria
{

    public class CmpHero : BaseEntityComponent
    {
        private AnimationIndexMan m_IndexControl;

        public override void Release()
        {
        }


        public CmpHero(GObjectID a_GID, ObjectManager objMan)
            : base(a_GID, objMan, ComponentTypeID.CID_MESSAGE_NONE)
        {
        }


        public override void Init()
        {
            
            AnimationIndexMan indexMan = new AnimationIndexMan();
            indexMan.SetDelay(0.125);
            indexMan.SetIndex(Vector2.Zero, 1);


            m_IndexControl = indexMan;
            m_IndexControl.StartAnimation();


            FactorySpriteInfo spriteInfo = new FactorySpriteInfo(SPRITE_TYPE_ID.ANIMATION_SPRITE, "Hero", indexMan);
            SpriteFactory spriteFactory = new SpriteFactory();


            ICmpRender render = new CmpDefaultRender(m_ObjectID, m_ObjectMan, (ISprite)spriteFactory.GetObject(spriteInfo), ComponentTypeID.CID_RENDER_CHILD);

            m_ObjectMan.AddComponent(render);

            base.Init();
        }

     

        public override void Update(GameTime gameTime)
        {
     
            base.Update(gameTime);
        }
        public override EMessageResult HandleMessage(GMessage a_Msg)
        {         
            
            return base.HandleMessage(a_Msg);
        }
    }
}
